// License Notification
//======================================================
// Copyright (c) 2010 Channel Intelligence Inc.
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// ======================================================




using System;

namespace CIP4.Common
{
    public class CollectionType 
    {
        private ExternalIDType _externalID;

        public ExternalIDType ExternalID
        {
            get { return _externalID ?? (_externalID = new ExternalIDType(Name)); }
            set { _externalID = value; }
        }


        public string Name { get; set; }

        public string Rules { get; set; }

        public string Xsd { get; set; }

        public Type CollectionCompoundType { get; set; }

        public string CacheDataProviderConnection { get; set; }

        public long CacheSizeQuota { get; set; }

        public TimeSpan CacheAgeQuota { get; set; }

        public string ExternalIDString()
        {
            return ExternalID.ToString();
        }

        public Guid ExternalIDGuid()
        {
            return Globals.GetHashValue(ExternalIDString());
        }

        public override string ToString()
        {
            return Name;
        }

    }

}
